package com.app.common.utils.mail;

import com.app.common.utils.ParamConfig;

/**
 * 
 * 发件箱工厂
 * 
 * 
 * 
 * @author MZULE
 * 
 * 
 */

public class MailSenderFactory {

	/**
	 * 
	 * 服务邮箱
	 */

	private static SimpleMailSender serviceSms = null;

	/**
	 * 
	 * 获取邮箱
	 * 
	 * 
	 * 
	 * @param type 邮箱类型
	 * 
	 * @return 符合类型的邮箱
	 */

	public static SimpleMailSender getSender() {

		//if (type == ParamConfig.getInstanse().getParam("mailSenderType")) {

			if (serviceSms == null) {

				serviceSms = new SimpleMailSender(ParamConfig.getInstanse().getParam("mailUsername")
							,ParamConfig.getInstanse().getParam("mailPassword"));

			}

			return serviceSms;

		//}

		// return null;

	}

}
